package entities;

import java.io.Serializable;

import javax.persistence.*;

@Entity
@Table(name="registered_user")
public class RegisteredUser implements Serializable {

	@Id
	@Column(name="userId")
	private String userId;
	private String password;
	private String name;
	private String surname;
	private String eMail;
	private String address;
	private String city;
	
	public RegisteredUser(String userId) {
		super();
		this.userId = userId;
	}
	
	public RegisteredUser(){
		
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getSurname() {
		return surname;
	}

	public void setSurname(String surname) {
		this.surname = surname;
	}

	public String geteMail() {
		return eMail;
	}

	public void seteMail(String eMail) {
		this.eMail = eMail;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getUserId() {
		return userId;
	}
	
	@Override
	public boolean equals(Object o){
		try{
			if(o == null){
				return false;
			}
			RegisteredUser ru = (RegisteredUser)o;
			if(userId.equals(ru.userId)){
				return true;
			}
			return false;
		} catch(ClassCastException e){
			return false;
		}
	}
	
	@Override
	public String toString(){
		return userId;
	}


}
